const HtmlWebpackPlugin = require('html-webpack-plugin');
const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
const path = require('path')
module.exports = {
  mode: 'development',
  devtool: false,
  entry: './src/index.js',
  output: {

  },
  devServer: {
    port: 4800
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        use: [
          {
            loader: 'babel-loader',
            options: {
              presets: ['@babel/preset-react']
            }
          }
        ],
        exclude: /node_modules/
      },

    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: './src/index.html'
    }),
    new ModuleFederationPlugin({
      filename: 'remoteEntry.js',
      name: 'host',
      remotes: {
        remote: 'remote@http://localhost:3800/remoteEntry.js'
      }
    })
  ]

}